<?php
require_once( './path.php' );

//调用初始化页面
require_once( CLASSMATE_ROOT.'/controller/display_script_init.php' );

if( session::get( 'is_online' ) ){

	 $response_message = array( 'type'=>'info' ,
	 		 'content'=>"您已经登录没有必要进行此操作。" ,
	 		 'url_des'=>'退出登录？' ,
	 		 'url'=>'/classmate/controller/account/do_logout.php' );
	 session::set( 'response_message' , $response_message );

	 header( 'Location: ../response_message.php' );
	 exit();
}

//如果是由于注册发生异常重定向而来
if( session::get('reg_fail_message') ){
	 
	$message = session::get( 'reg_fail_message' ); 
	 
	$tpl->assign( 'reg_fail_message' , true );
	$tpl->assign( 'content' , $message['content'] );
	$tpl->assign( 'type' , $message['type'] );

	session::clear('reg_fail_message');
}

$tpl->assign( 'title' , '用户注册页面' );
$tpl->display( 'account/reg.tpl' );

